FROM openjdk:11-jdk
LABEL maintainer="云计算金哥 <research@yyds.cn>"

# 时区修改为东八区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /app
ARG JAR_FILE=target/*.jar
ADD ${JAR_FILE} app.jar

EXPOSE 8080

# 修改后的ENTRYPOINT指令，增加了JVM内存配置
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -Xms128M -Xmx256M -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256M -jar $JAVA_OPTS app.jar"]